//
//  NSDictionary+RemoveNUll.m
//  JMDome_1
//
//  Created by ios on 15/6/11.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "NSDictionary+RemoveNUll.h"

@implementation NSDictionary (RemoveNUll)


+ (instancetype) removeDictionaryKeyValueWithNull:(NSDictionary *)dict{
    if(dict){
        NSMutableDictionary *retuenDict = [NSMutableDictionary dictionary];
        for(int i = 0; i<[dict allKeys].count;i++){
            NSString *key = [NSString stringWithFormat:@"%@",[[dict allKeys] objectAtIndex:i]];
            NSString *value= @"";
            if([dict[key] isKindOfClass:[NSNull class]] || dict[key] == nil ||[dict[key] isEqual:[NSNull null]]){
                value = @"";
            }else{
                value = [NSString stringWithFormat:@"%@",dict[key]];
            }
            [retuenDict setObject:value forKey:key];
        }
        return (NSDictionary *)retuenDict;
    }else{
        return nil;
    }
}

@end
